# ！ /usr/bin/python3
# -*- coding:utf-8 -*-
# @Author:Peng Cao
# @File: 001accss_token.py
# @Software: PyCharm
"""
读取成员
"""
import requests
from Api_qwx_pr import info_corp

corpId = info_corp.corpId
secret_customer = info_corp.secret_staff
# 获取access_token
params = {'corpid': corpId, 'corpsecret': secret_customer}
res = requests.get(url="https://qyapi.weixin.qq.com/cgi-bin/gettoken", params=params)
access_token = res.json()["access_token"]
print(res.json())
print(access_token)
# 读取成员
data = {
    "access_token": access_token,
    "userid": "CaoPeng",
}

res = requests.get(url=f'https://qyapi.weixin.qq.com/cgi-bin/user/get', params=data)
print(res.text)
